package demo3;

import java.util.Objects;

public class Triangle extends Shape{
    public Triangle(String name) {
        super(name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }

    @Override
    public boolean equals(Object obj) {
        if(obj == null){
            return false;
        }

        if(obj == this){
            return true;
        }

        Rect tmp = (Rect)obj;
        return tmp.name.equals(this.name) ;
    }
}
